using System;
using System.Data;
using System.Collections.Generic;

namespace Dbam.DbFramework.Tests
{
	[Table("Accounts")]
	class AccountEntity
	{
		private Guid _accountId;
		private string _name;
		private DateTime? _lastLogon;
		private DateTime _memberSince;
		private List<Session> _sessions;

		public AccountEntity()
		{
			_sessions = new List<Session>();
		}

		[Column("Id", DbType.Guid, true)]
		public Guid AccountId
		{
			get { return _accountId; }
			set { _accountId = value; }
		}

		[Column("Name", DbType.String, false)]
		public string Name
		{
			get { return _name; }
			set { _name = value; }
		}

		[Column("LastLogon", DbType.DateTime, false)]
		public DateTime? LastLogon
		{
			get { return _lastLogon; }
			set { _lastLogon = value; }
		}

		[Column("OpenDate", DbType.DateTime, false)]
		public DateTime OpenDate
		{
			get { return _memberSince; }
			set { _memberSince = value; }
		}

		[Relation("Id", "Sessions", "ParentAccountId", typeof(Session))]
		public List<Session> Sessions
		{
			get { return _sessions; }
		}
	}
}